package LabPrueba;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;

public class ConsultaDB {
	public ConsultaDB() {}
	
	public List GetOne(int id) throws Exception{
		List oConsultas = new ArrayList();
		Statement stmt = null;   //
		ResultSet rs = null;	//
		try{
			Connection oCnn = Datos.General.CrearConexion();
			
			stmt = oCnn.createStatement();  //
			String sql = "Select * FROM `banco` WHERE idBanco=" + id;
			rs = stmt.executeQuery("Select  * FROM `banco` WHERE idBanco=205");  //
			rs = stmt.executeQuery(sql);  //
			while(rs.next()){
				System.out.println("Nombre del Banco: " + rs.getInt(1) + " = " + rs.getString(2));
				}
			return oConsultas;

		} catch (Exception ex){
			   System.out.println("SQLException: " + ex.getMessage());
		}
		return oConsultas;
	}
}

